<%@ page import="com.dingpeikeji.quickdeer.modules.rentproduct.entity.TDemands" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="REACTSTATUS_WAIT" value="<%=TDemands.REACTSTATUS_WAIT %>" />
<c:set var="REACTSTATUS_DONE" value="<%=TDemands.REACTSTATUS_DONE %>" />
<c:set var="REACTSTATUS_SURE" value="<%=TDemands.REACTSTATUS_SURE %>" />
<html>
<head>
<meta name="decorator" content="front" />
<title>关于发票</title>
<link href="${ctxStatic }/xiake/css/list.css" rel='stylesheet'type='text/css' />
<link href="${ctxStatic }/xiake/css/style.css" rel='stylesheet'type='text/css' />
<style type="text/css">
.fp_title{
	height: 40px;
	line-height: 40px;
	background-color: #efefef;
	padding-left: 10px;
}
.fp_title span{
	float:right;
	padding-right: 10px;
	color:#4FBDBA;
}
.fp_title span a{
	color:#4FBDBA;
}
.fp_tip{
	height: 40px;
	line-height: 40px;
	padding-left: 10px;
}
.fp_tip span{
	display: inline-block;
	margin-left: 50px;
	width:80px;
	height: 30px;
	line-height: 30px;
	text-align: center;
	color: #fff;
	font-size: 12px;
	background-color:#4FBDBA;
}
.fp_tip span a{
	color: #fff;
	font-size: 12px;
	
}
.fp_list{
	margin-top: 10px;
}
.fp_list table {
	width: 100%;
	background-color:#D5D5D5; 
	border: 0;
	padding: 0;
	margin: 0;
	cellspacing:0;
	
}
.fp_list table tr{
	height: 40px;
	line-height: 40px;
}
.fp_list table tr th{
	color:#666;
}
.fp_list table tr td,th{
	text-align: center;
}
.bgwhile{
	background-color: #fff;
}
.selectall{
	display: inline-block;
	height: 20px;
	line-height: 20px;
	margin-left: 5px;
}
.labelmoney{
	font-size: 18px;
	color: #4FBDBA;
	padding-left: 5px;
}
.fpremark{
	line-height: 25px;
	color:#4FBDBA;
}
</style>
<script>
	//选择事件
	function ckall(t)
	{
		var ck=$(t).attr("checked");
		if(ck=="checked")
		{
			//全选
			$(".selectall").html("取消");
			$(".selectChild").attr("checked","checked");
			
		}else
		{
			//取消
			$(".selectall").html("全选");
			$(".selectChild").removeAttr("checked");
		}
		//计算开票金额
		JSfpmoney();
		
	}
	//计算开票金额
	function JSfpmoney()
	{
		var allmoney=0;
		//fpmoney
		$(".fp_list table tr td").find("input").each(function(){
			var ck=$(this).attr("checked");
			if(ck=="checked")
			{
				var v=$(this).parent().parent().find(".fpmoney").html();
				allmoney+=parseFloat(v);
			}
		});
		$(".labelmoney").html("￥"+allmoney);
	}
	
	function check() {
		var checkboxs = $("input[type=checkbox].selectChild");
		if(checkboxs.length == 0) {
			alert('请选择需要开票的订单！');
			return;
		}
		$('#inputForm').submit();
	}
</script>
</head>
<body>
	<div class="container font_normal_size"> 
		<c:set var="siderMenuName" value="关于发票"/>
		<%@ include file="/WEB-INF/views/modules/base/siderMenu.jsp"%>
		<div class="container_con">
			<!--     标题 -->
			<div class="fp_title">
				可开发票列表
		    	<span><a href="${ctxFront }/usersRcpt/userInfo">开票信息</a></span>
				<span><a href="${ctxFront }/usersRcpt/history">开票记录</a></span>
		    </div>
		    <!--     操作 -->
		    <div class="fp_tip">
		    	已选总金额:<label class="labelmoney">￥0.00</label>
		    	<span><a href="javascript:check();">立刻开票</a></span>
		    </div>
			<!--     列表 -->
		    <div class="fp_list">
		    	<form id="inputForm" action="${ctxFront }/usersRcpt/userInfo" method="post">
			    	<table cellpadding="0" cellspacing="1">
			    		<tr>
			    			<th><input type="checkbox" onclick="ckall(this)"  class="selectParent"><span class="selectall">全选</span></th>
			    			<th>订单号</th>
			    			<th>订单名称</th>
			    			<th>可开票金额</th>
			    			<th>支付时间</th>
			    		</tr>
			    		<c:forEach items="${ordersList}" var="orders">
				    		<tr class="bgwhile">
				    			<td><input type="checkbox" name="rcptIds" value="${orders.orderid }" onclick="JSfpmoney()" class="selectChild"></td>
				    			<td>${orders.orderid }</td>
				    			<td>${orders.ordername }</td>
				    			<td class="fpmoney">${orders.dueamount}</td>
				    			<td><fmt:formatDate value="${orders.paydate }" pattern="yyyy-MM-dd"/></td>
				    		</tr>
			    		</c:forEach>
			    	</table>
		    	</form>
		    </div>
		    <!--     开票规则 -->
			<div class="fpremark">
				<p>开票规则：</p>
				<p>1、开票内容仅支持代办租车费，发票类型仅支持增值税普通发票。</p>
				<p>2、您可按订单申请开票，可开票金额为订单实际支付金额。</p>
				<p>3、单次申请开票合计满1000元包邮，不满1000元邮费到付。暂不支持港澳台地区包邮。</p>
				<p>4、开具发票需提供：发票抬头、收件人及电话、邮寄地址、邮编。</p>
				<p>5、增值税普通发票我们将在3-7个工作日寄出。</p>
				<p>6、因个人原因导致发票退回重开，所产生的往返快递费用由您自行承担。</p>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</body>
</html>